﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
             this.ddl.DataTextField = "Key";
                this.ddl.DataValueField = "Value";
                this.ddl.DataSource = new List<KeyValuePair<string, string>>(){
            new KeyValuePair<string,string>("wo shi 1","wo shi 1"),
            new KeyValuePair<string,string>("wo shi 2","wo shi 2"),
            new KeyValuePair<string,string>("wo shi 3","wo shi 3")     
            };
                this.ddl.DataBind();
                this.ddl.SelectedIndex = 0;
            if (this.IsPostBack)
            {
                this.ddl.SelectedValue = Request.Form["ddl"];
            }
            else
            {
                this.ddl.DataBind();
                this.ddl.SelectedIndex = 0;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            
        }
    }
}